{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    {include file="form" /}
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            <a class="btn btn-primary radius mr-5" href="javascript:;" onclick="layer_open('发送消息','/admin/notify/add')"><i class="Hui-iconfont">&#xe600;</i> 发送消息</a>'
            {tp:menu menu="forbid,resume,delete,recyclebin" /}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="th" /}
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="td" /}
            <td class="f-14">
                {if $vo.isread==0}
                <a href="javascript:;" onclick="read('{$vo.id}')" class="label label-success radius" title="未读">未读</a>
                {else}
                <!--<a href="javascript:;"  onclick="read('{$vo.id}')" class="label label-success radius" title="已读">已读</a>-->
                <a href="javascript:;" class="label label-success radius" title="已读">已读</a>
                {/if}
                {$vo.status|show_status=$vo.id}
                {tp:menu menu='sedit' /}
                {tp:menu menu='sdelete' /}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
</div>
{/block}

{block name="script"}
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script>
        function read(id){
            var xmlhttp;
            if (window.XMLHttpRequest)
            {
                xmlhttp=new XMLHttpRequest();
            }
            else
            {
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function()
            {
                if (xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                    alert("修改成功");
                    location.reload();
                }
            }
            xmlhttp.open("GET","/admin/notify/is_read?id="+id,true);
            xmlhttp.send();
        }
</script>

<script>
    function driverInfo(id) {
        var url = '/admin/driver/details';
        if (!id){
            layer.msg('缺少必要的参数');
        }
        $.ajax({
            type: 'get',
            url: url,
            data:{ id: id },
            success: function (data) {
                if (data.code == 1){
                    layer.msg(data.msg)
                    return false
                }else{
                    layer_open('详细资料','/admin/driver/details/id/'+id,{w:'1300px',h:'750px'})
                }
            }
        })
    }
</script>
{/block}

